class UiElementModel {
  TitleText? mainTitle;
  TitleText? subTitle;
  ElementImage? image;
  List<String>? labelTexts;
  String? rcmdShowType;
  ElementButton? button;

  UiElementModel(
      {this.mainTitle,
      this.subTitle,
      this.image,
      this.labelTexts,
      this.rcmdShowType});

  UiElementModel.fromJson(Map<String, dynamic>? json) {
    mainTitle = json?['mainTitle'] != null
        ? new TitleText.fromJson(json?['mainTitle'])
        : null;
    subTitle = json?['subTitle'] != null
        ? new TitleText.fromJson(json?['subTitle'])
        : null;
    image = json?['image'] != null
        ? new ElementImage.fromJson(json?['image'])
        : null;
    button = json?['button'] != null
        ? new ElementButton.fromJson(json?['button'])
        : null;
    if (json?['labelTexts'] != null) {
      labelTexts = json?['labelTexts'].cast<String>();
    }

    rcmdShowType = json?['rcmdShowType'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.mainTitle != null) {
      data['mainTitle'] = this.mainTitle!.toJson();
    }
    if (this.subTitle != null) {
      data['subTitle'] = this.subTitle!.toJson();
    }
    if (this.image != null) {
      data['image'] = this.image!.toJson();
    }
    if (this.button != null) {
      data['button'] = this.button!.toJson();
    }
    data['labelTexts'] = this.labelTexts;
    data['rcmdShowType'] = this.rcmdShowType;
    return data;
  }
}

class ElementImage {
  String? imageUrl;

  ElementImage({this.imageUrl});

  ElementImage.fromJson(Map<String, dynamic> json) {
    imageUrl = json['imageUrl'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['imageUrl'] = this.imageUrl;
    return data;
  }
}

class ElementButton {
  String? action;
  String? actionType;
  String? text;
  Null? iconUrl;
  Null? biData;

  ElementButton(
      {this.action, this.actionType, this.text, this.iconUrl, this.biData});

  ElementButton.fromJson(Map<String, dynamic> json) {
    action = json['action'];
    actionType = json['actionType'];
    text = json['text'];
    iconUrl = json['iconUrl'];
    biData = json['biData'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['action'] = this.action;
    data['actionType'] = this.actionType;
    data['text'] = this.text;
    data['iconUrl'] = this.iconUrl;
    data['biData'] = this.biData;
    return data;
  }
}

class TitleText {
  String? title;
  String? titleImgUrl;

  TitleText({this.title});

  TitleText.fromJson(Map<String, dynamic> json) {
    title = json['title'];
    titleImgUrl = json['titleImgUrl'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['title'] = this.title;
    data['titleImgUrl'] = this.titleImgUrl;
    return data;
  }
}
